package org.xdq.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.xdq.dto.CustomerDto;
import org.xdq.model.Customer;


public interface CustomerDao {

	//@Select("select * from info_customer")
	List<Customer> findCustomerList(CustomerDto dto);

	@Select("select ifnull(max(cus_id),0) from info_customer")
	int findMaxId();

	@Insert("insert into info_customer(cus_id,cus_name,cus_remark,cus_status) values(#{cus_id},#{cus_name},#{cus_remark},'00')")
	void insertOneCustomer(CustomerDto dto);

	@Update("update info_customer set cus_name = #{cus_name} , cus_remark = #{cus_remark} where cus_id = #{cus_id}")
	void updateOneCustomer(CustomerDto dto);

	void deleteCustomers(@Param("ids") Integer... id);

}
